<?php

//Route::group(['namespace'=>'App\Http\Controllers\Api\Task','prefix'=>'api','middleware'=>'WebAuth'],function(){

//登录中间件
Route::group(['namespace'=>'App\Http\Controllers\Api\Home','prefix'=>'api','middleware'=>'WebAuth'],function(){
    //个人中心首页
    Route::any('home/index', 'HomeController@homeIndex');

    //地址列表
    Route::any('home/address_index', 'AddressController@addressIndex');
    //地址详情
    Route::any('home/get_address', 'AddressController@getAddress');
    //添加地址
    Route::post('home/add_address', 'AddressController@addAddress');
    //修改地址
    Route::post('home/update_address', 'AddressController@updateAddress');
    //删除地址
    Route::post('home/delete_address', 'AddressController@deleteAddress');

    //获取三级联动地址
    Route::any('home/get_area', 'AddressController@getArea');

    //个人健康档案
    Route::any('home/health_archives', 'HomeController@healthArchives');
    Route::post('home/update_archives', 'HomeController@updateArchives');
    Route::post('home/update_field', 'HomeController@updateField');

    //文章管理
    //获取用户协议
    Route::any('home/agreement', 'ArticleController@getAgreement');
    //获取问题
    Route::any('home/problem', 'ArticleController@getProblem');
    //获取分类下的文章
    Route::any('home/category_article', 'ArticleController@categoryArticle');
    //分类列表
    Route::any('home/category_index', 'ArticleController@categoryIndex');
    //添加分类
    Route::post('home/add_category', 'ArticleController@addCategory');
    //修改分类
    Route::post('home/update_category', 'ArticleController@updateCategory');
    //删除分类
    Route::post('home/delete_category', 'ArticleController@deleteCategory');
    //文章列表
    Route::any('home/article_index', 'ArticleController@articleIndex');
    //添加文章
    Route::post('home/add_article', 'ArticleController@addArticle');
    //修改文章
    Route::post('home/update_article', 'ArticleController@updateArticle');
    //删除文章
    Route::post('home/delete_article', 'ArticleController@deleteArticle');

    //每日签到
    Route::post('home/daily_sign', 'HomeController@dailySign');
    //食品列表
    Route::any('foods/get_cats','FoodsController@getFoodsCategories');
    Route::any('foods/get_foods_list','FoodsController@getFoodsList');
});